package cn.edu.nju.ws.sview.views.data;

import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;

import cn.edu.nju.ws.sview.views.Entity;
import cn.edu.nju.ws.sview.views.data.EntityBrowsing.QuadItem;

public class uriRelationRecomm extends CustEntityRelateRecomm{

	public uriRelationRecomm(String lang) {
		super(lang);
		this.itemType = 2;
		this.recType = RecType.URI_RELATION_BASED;
	}
	
	protected HashMap<Integer, Integer> getCandidates(int itemId){
		HashMap<Integer, Integer> ret = new HashMap<Integer, Integer>();
		HashSet<Integer> entities = Entity.getEntitiesHavingURIByBookmark(itemId, this.itemType, this.lang);
		for(int en : entities){
			if(en == itemId)
				continue;
			int key = Entity.getMembersByEntityId(en).size();
			ret.put(en, key);
		}
		return ret;
	}
	/*
	@Override
	public LinkedList<QuadItem> getRecommandItems(int itemId, String itemType)
			throws Exception {
		Set<Integer> cand = this.getCandidates(itemId).keySet();
		LinkedList<QuadItem> ret = new LinkedList<QuadItem>();
		for(int i : cand){
			ret.add(PackingService.pack(i, "1", this.lang));
		}
		return ret;
	}*/
	
}
